From 74a1c60dd41fafd53a64d570b62fc3f09b86a90b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Sun, 17 May 2020 15:28:16 +0200 Subject: [PATCH] windowhandle: Apply surface transform before passing coords to GDK Otherwise coordinates are incorrect and the window can jump around after starting a drag. --- gtk/gtkwindowhandle.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gtk/gtkwindowhandle.c b/gtk/gtkwindowhandle.c index 3e411465b5..6ee052e9a4 100644 --- a/gtk/gtkwindowhandle.c +++ b/gtk/gtkwindowhandle.c @@ -442,7 +442,8 @@ drag_gesture_update_cb (GtkGestureDrag *gesture, { GdkEventSequence *sequence; double start_x, start_y; - gint window_x, window_y; + int native_x, native_y; + int window_x, window_y; GtkNative *native; GdkSurface *surface; @@ -480,6 +481,10 @@ drag_gesture_update_cb (GtkGestureDrag *gesture, start_x, start_y, &window_x, &window_y); + gtk_native_get_surface_transform (native, &native_x, &native_y); + window_x += native_x; + window_y += native_y; + surface = gtk_native_get_surface (native); gdk_surface_begin_move_drag (surface, gtk_gesture_get_device (GTK_GESTURE (gesture)), -- 2.30.2